<template>
  <div>
    <table style="width: 1370px" id="out-table" border="0">
      <tr class="thr">
        <th>手机号</th>
        <th>用户名</th>
        <th>行政区域</th>
        <th>推荐人</th>
        <th>添加时间</th>
        <th>状态</th>
      </tr>
      <tr v-for="(item,index) in itemData" class="tdr">
        <td>{{item.phone}}</td>
        <td>{{item.realname}}</td>
        <td>{{item.address}}</td>
        <td>{{item.upper_name}}</td>
        <td>{{item.insert_time}}</td>
        <td>
          <div style="display: flex;justify-content: flex-start;align-items: center">
            <div style="display:flex;align-items: center;width: 50px">
                  <span style="color:#3a8ee6"
                        v-show="item.status==1||item.status==0">正常</span>
              <span v-show="item.status==3">已冻结</span>
            </div>
            <el-button
              size="mini"
              type="warning"
              v-show="item.status==3"
              @click="handleRecover(index, item.user_id)">恢复
            </el-button>
            <el-button
              size="mini"
              type="danger"
              v-show="item.status==1||item.status==0"
              @click="handleFreeze(index, item.user_id)">冻结
            </el-button>
            <el-button
              size="mini"
              type="primary"
              @click="handleEdit(index, item.user_id)">编辑
            </el-button>
          </div>
        </td>
      </tr>
    </table>
    <div v-show="this.$_.isEmpty(itemData)" style="width:1370px;font-size:14px;border-bottom: 1px solid #ebeef5; height: 60px;display: flex;justify-content: center;align-items: center;color: #999;">
      暂无数据
    </div>
  </div>
</template>

<script>

    export default {
        name: "AgentTable",
       props: ['status', 'itemData'],
      methods:{
        handleRecover(index,user_id){
          this.$emit('handleRecover',{index,user_id})
        },
        handleFreeze(index,user_id){
          this.$emit('handleFreeze',{index,user_id})
        },
        handleEdit(index,user_id){
          this.$emit('handleEdit',{index,user_id})
        },
      }
    }
</script>

<style scoped>


  th{
    text-align: left;
    width: 180px;
    color: #555555;
  }
  td{
    color: #888;
  }
  th, td{
    padding: 10px;
    font-size: 14px;
    border-bottom: 1px solid #dedede;
    vertical-align: middle;
  }
</style>
